<?php

class EmailValidator implements Zend_Validate_Interface
{
	protected $_validator;
	
	public function __construct()
	{
		$this->_validator = new Zend_Validate();
		$this->_validator->AddValidator(new Zend_Validate_StringLength(5, 30));
		$this->_validator->AddValidator(new Zend_Validate_Regex(array('pattern'=>'/^[\w\d\-_\.]{1,30}@[\w\d\-_\.]{1,30}$/')));
	}
	
	public function isValid($value)
	{
		return $this->_validator->isValid($value);
	}
	public function getMessages()
	{
		return $this->_validator->getMessages();
	}
}

?>
